//
//  UIView+AutoLayout.h
//  PAEBank
//
//  Created by Peng on 2018/3/23.
//  Copyright © 2018年 PingAn. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (AutoLayout)

/**
 把自身加入到VC上填充整个屏幕顶部到topLayoutGuaid底部到bottomLayoutGuaid

 @param view 要添加的view
 @param vc 容器所在控制器
 */
- (void)addSubview:(UIView *)view toViewController:(UIViewController *)vc;


/**
  添加自身的的宽度约束

 @param width 宽度
 */
- (void)addWidth:(CGFloat)width;


/**
 添加自身的的高度约束

 @param height 高度
 */
- (void)addHeight:(CGFloat)height;

//

/**
 自身的的宽与传入view的相等

 */
- (void)equalWidthTo:(UIView *)view;


/**
 自身的的高与传入view的相等
 
 */
- (void)equalHeightTo:(UIView *)view;



/**
 view放置到父容器(self)中，距离（self）上下左右的距离

 @param insets 边距
 */
- (void)addSubview:(UIView *)view withInsets: (UIEdgeInsets) insets;


/**
 self的顶部到view的顶部的距离

 @param interval 间距
 */
- (void)topToTopWithView:(UIView *)view andInterval:(CGFloat) interval;


/**
 self的顶部到view的底部的距离
 
 @param interval 间距
 */
- (void)topToBottomWithView:(UIView *)view andInterval:(CGFloat) interval;


/**
 self的底部到view的底部的距离
 
 @param interval 间距
 */
- (void)bottomToBottomWithView:(UIView *)view andInterval:(CGFloat)interval;


/**
 self的左边到view的左边的距离
 
 @param interval 间距
 */
- (void)leftToLeftWithView:(UIView *)view andInterval:(CGFloat)interval;


/**
 self的左边到view的右边的距离
 
 @param interval 间距
 */
- (void)leftToRightWithView:(UIView *)view andInterval:(CGFloat)interval;


/**
 self的中心点X坐标到view的中心点X坐标的距离
 
 @param interval 间距
 */
- (void)centerXToCenterXWithView:(UIView *)view andInterval:(CGFloat)interval;


/**
 self的中心点Y坐标到view的中心点Y坐标的距离
 
 @param interval 间距
 */
- (void)centerYToCenterYWithView:(UIView *)view andInterval:(CGFloat)interval;


@end
